import axios from 'axios';
import {ALL_SERVICE_API} from '../api';
// var qs = require('qs');

export const searchALLPayWayConfigNew = (param) => {
  return axios.get(ALL_SERVICE_API + '/pay-way-configs', {params: param});
};

export const searchTruckLoadPayWayConfig = (param) => {
  return axios.get(ALL_SERVICE_API + '/truck-load-pay-way-configs', {params: param});
};

export const savePayWayConfig = (param) => {
  return axios.put(ALL_SERVICE_API + '/pay-way-configs/batch-save', param);
};

export const saveTruckLoadPayWayConfig = (param) => {
  return axios.post(ALL_SERVICE_API + '/truck-load-pay-way-configs/resave-all', param);
};

export const createPayWayConfig = (param) => {
  return axios.put(ALL_SERVICE_API + '/pay-way-configs', param);
};

export const createTruckLoadPayWayConfig = (param) => {
  return axios.put(ALL_SERVICE_API + '/truck-load-pay-way-configs/', param);
};

export const savePayWayConfigMebPersonal = (id, param) => {
  return axios.post(ALL_SERVICE_API + '/pay_way_configs/' + id, param);
};

export const saveTruckLoadPayWayConfigMebPersonal = (id, param) => {
  return axios.post(ALL_SERVICE_API + '/truck-load-pay-way-config-meb-personals/add-by-config-id/' + id, param);
};

export const searchPayWayConfigMebPersonal = param => {
  return axios.get(ALL_SERVICE_API + '/pay-way-config-meb-personalVOs', {params: param});
};

export const searchTruckLoadPayWayConfigMebPersonal = param => {
  return axios.get(ALL_SERVICE_API + '/truck-load-pay-way-config-meb-personalsvo', {params: param});
};

export const deletePayWayConfigMebPersonal = id => {
  return axios.delete(ALL_SERVICE_API + '/pay-way-config-meb-personals/' + id);
};

export const deleteTruckLoadPayWayConfigMebPersonal = id => {
  return axios.delete(ALL_SERVICE_API + '/truck-load-pay-way-config-meb-personals/' + id);
};
